﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Web._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        function ShowYZ() {
            var xm = $("#xm").val();
            var mm = $("#mm").val();

            if (xm == "") {
                alert("请输入姓名！");
            }
           else if (mm == "") {
                alert("请输入密码！");
            }
            else {
                $.ajax({
                    type: "POST",
                    dataType: "text",
                    url: 'do.aspx', //提交到处理程序请求数据
                    data: { DoType: "CheckBD", SXM: xm, XMM: mm },
                    success: function (data) {
                        if (data == 1) {
                            alert("验证成功!");
                            return false;
                        }
                        if (data == 0) {
                            alert("验证失败!");
                            return false;
                        }
                        else {
                            alert("系统异常!");
                            return false;
                        }
                    }
                });
            }
            return false;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table id="Result" cellspacing="0" cellpadding="0" width="500">
            <tr>
                <td>
                    姓名：
                </td>
                <td>
                    <input id="xm" type="text" value="" runat="server" />
                </td>
                <td>
                    密码：
                </td>
                <td>
                    <input id="mm" type="text" value="" runat="server" />
                </td>
                <td>
                    <input id="btnSure" type="button" value="验证" onclick="ShowYZ()" style="width: 90px;" />
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
